// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "STWindowInfo.h"
#include "WindowUMGmgrActor.generated.h"

class SWindow;
class UUserWidget;
class SDockTab;
class FSpawnTabArgs;
class USTAdditionaltViewport;

UCLASS(BlueprintType, Blueprintable)
class STUMGWINDOWS_API AWindowUMGmgrActor : public AActor
{
	GENERATED_BODY()

public:




	// Sets default values for this actor's properties
	AWindowUMGmgrActor();


	UFUNCTION(BlueprintCallable, Category = "UMGWindowsLib")
	bool InitWindowAndUMG(FVector2D windowSize, FVector2D windowPos);



	UFUNCTION(BlueprintCallable, Category = "UMGWindowsLib", meta = (DeterminesOutputType = "actorClass"))
	AActor* AddActor(TSubclassOf<AActor> actorClass, FTransform tsf);

	UFUNCTION(BlueprintCallable, Category = "UMGWindowsLib")
	void SetViewPoint(FVector p, FRotator r);


	UFUNCTION(BlueprintCallable, Category = "UMGWindowsLib")
	void GettViewPoint(FVector& p, FRotator& r);


	UFUNCTION(BlueprintCallable, Category = "UMGWindowsLib", meta = (DeterminesOutputType = "actorClass"))
	TArray<AActor*> GetAllViewActor(TSubclassOf<AActor> actorClass);

	UFUNCTION(BlueprintCallable, Category = "UMGWindowsLib")
	bool ResetPos(FVector2D windowPos);

	UFUNCTION(BlueprintCallable, Category = "UMGWindowsLib")
	bool ResetSize(FVector2D windowSize);


	UFUNCTION(BlueprintCallable, Category = "UMGWindowsLib")
	bool ResetWindowMode(ESTwindowMode wm);


	UFUNCTION(BlueprintCallable, Category = "UMGWindowsLib")
	bool GetWindowInfo(FVector2D& windowPos, FVector2D& windowSize, ESTwindowMode& wm);

	UFUNCTION(BlueprintCallable, Category = "UMGWindowsLib")
	bool CloseWindow();


protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

	virtual void EndPlay(const EEndPlayReason::Type EndPlayReason)override;

public:
	// Called every frame
	virtual void Tick(float DeltaTime) override;

private:
	TSharedPtr<SWindow> windowPt;
	USTAdditionaltViewport* AdditionaltViewport;

};
